//
//  ShowCell1.swift
//  AgricultureApp
//
//  Created by eport_user1 on 2018/1/12.
//  Copyright © 2018年 eport_user1. All rights reserved.
//

import UIKit
import Kingfisher

class ShowCell1: UITableViewCell {

    
    @IBOutlet weak var titleLabel: UILabel!
    
    @IBOutlet weak var showImgView: UIImageView!
    
    
    @IBOutlet weak var detailTextView: UITextView!
    
    
    @IBOutlet weak var timeLabel: UILabel!
    
    var model:HomeModel?
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        
        titleLabel.font = UIFont.systemFont(ofSize: 17)
        titleLabel.textColor = UIColor.black
        
        detailTextView.isEditable = false
        detailTextView.font = UIFont.systemFont(ofSize: 13)
        
        timeLabel.font = UIFont.systemFont(ofSize: 15)
        timeLabel.textColor = UIColor.gray
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        //"\(model?.publish_time ?? "")  \(model?.factModel?.full_name)"
        
        titleLabel.text = model?.title
        detailTextView.text = model?.summary
        let string1 = model?.publish_time
        let string2 = model?.factModel?.full_name
        
        
        let strings = (string1)! + (string2)!
        timeLabel.text = string2
    
        let url = URL.init(string: (model?.thumb_url)!)
        showImgView.kf.setImage(with: url)
        
    
    }
    
    
    
}
